<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		
		*{
			margin: 0px;
			padding: 0px;
		}
		li{
			list-style: none;
		}
		.menu{
			width: 100%;
			height: 40px;
			background: #01204F url() 0 0 no-repeat;
			margin-top: 100px;
			position: relative;
		}
		.mid{
			width: 80%;
			height: 40px;
			margin:0 auto;
			position: relative;
		}
		.list{
			width: 100%;
			position: relative;
			top: 0px;
			left: 0px;
			z-index: 999;
		}
		.item{
			height: 40px;
			float: left;
			color: #fff;
			line-height: 40px;
			font-weight: 600;
			padding:0px 15px;
			cursor: pointer;
		}
		.fisrt{
			background: #CC0000 url() 0 0 no-repeat;
		}
		.bg{
			width: 10px;
			height: 40px;
			background: #CC0000 url() 0 0 no-repeat;
			position: absolute;
			top: 0px;
			left: 0px;
		}
	</style>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
	<script>
		
		$(function () {
			
			$('.item').hover(function() {
				width=  $(this).width();
				left = $(this).position().left;

				$('.bg').stop().animate({left:left+'px',width:width+30+'px'}, 100);
			}, function() {
				$('.bg').stop().animate({left:'0px',width:'10px'}, 100);
			});
			
		})
	</script>
</head>
<body>
	<div class="menu">
		<div class="mid">
			<ul class="list">
				<li class="item fisrt">首页</li>
				<li class="item">百家号</li>
				<li class="item">国内</li>
				<li class="item">国际</li>
				<li class="item">互联网</li>
				<li class="item">财经</li>
				<li class="item">个性推荐</li>
			</ul>
			<div class="bg">
				
			</div>
		</div>
		
	</div>
</body>
</html>